package hesso.smartdraw.ch.guielements;

import hesso.smartdraw.ch.model.Wall;

import org.anddev.andengine.entity.primitive.Line;

public class WallLine extends Line {
	
	private static int globalCounter = 0;	
	private int myNumber;
	private String description;

	private Wall modelWall;

	public WallLine(float pX1, float pY1, float pX2, float pY2) {
			// Cant use a instanz variable, because its the construcotr, duh!
		super(pX1, pY1, pX2, pY2, 10);		
		WallLine.globalCounter++;
		this.myNumber = WallLine.globalCounter;
		this.setDescription("Wall #" + this.myNumber);
		this.setColor(1f, 1f, 1f);
	}
	
	public WallLine(Wall mWall){
			// Cant use a instanz variable, because its the construcotr, duh!
		super(mWall.getX1(), mWall.getY1(), mWall.getX2(), mWall.getY2(), 10);
		this.modelWall = mWall;
		
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}
	
	public Wall getModelWall() {
		return modelWall;
	}

	public void setModelWall(Wall modelWall) {
		this.modelWall = modelWall;
	}
	
	@Override
	public void setPosition(float x1, float y1, float x2, float y2){
		super.setPosition(x1, y1, x2, y2);
		if(this.modelWall != null)
			this.modelWall.setPosition(x1, y1, x2, y2);
		
	}
}